<?php
class TransferAction extends BaseAction {
	public function __construct($name) {
		parent::__construct($name);
	}
	
	public function execute(ezcWorkflowExecution $execution) {
        $startTime = time();
        
		$variables = CJSON::decode($execution->getVariable('params'));
		$output = $variables['outputs'][0];
		$resourceService = ResourceService::getInstance();		
    	$destSystem = $resourceService->getStorageSystem($output['system_id']);
		
    	$execution->setVariable('type', $destSystem['storage_type']);
        
    	$runtimeInfo = $execution->getVariable('runtimeInfo');
		$runtimeInfo['cost'][$this->name] = time() - $startTime;
		$execution->setVariable('runtimeInfo', $runtimeInfo);
        return $status;
	}
}